<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <title>Document</title>
</head>
<body>
    <div id="test">
        <input type="button" :value="bText" @click="toggle">
        <div v-show="show">
            <img src="img/face.png">
        </div>
    </div>
    <script>
        new Vue({
            el:'#test',
            data:{
                bText:'隐藏图片',
                show:true
            },
            methods: {
                toggle:function(){
                    this.bText=='隐藏图片' ? this.bText='显示图片':this.bText='隐藏图片';
                    this.show = !this.show
                }
            }
        })
    </script>
</body>
</html>